home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 2 / BBS in a box - Trilogy II.iso / Files / Hyper / Q-R / Rev. Xref-Text / card_5779.txt < prev    next >
Encoding:
Text File  |  1987-09-28  |  2.7 KB  |  65 lines

  1. -- card: 5779 from stack: in. Xref-Text
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 2746
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 2
  9. ----- text -----
  10. Topic
  11.  
  12. -- part contents for background part 1
  13. ----- text -----
  14.  
  15. This is the original text of the GEnie topic that got Xref-Text started:
  16.  
  17. -- True HyperText* in HyperCard:
  18.  -- -- BUTTONS IN SCROLLING FIELDS! [or any kind of field, for that matter] -- -- make this the script of a locked text field on a card or background 
  19. -- you can click on any word to select it and go to card of that
  20.  -- name or number.
  21.  -- -- by Raines Cohen for the BMUG* HyperCard SIG 9/16/87
  22.  -- [now meets* every other Monday at 6 PM at BMUG] 
  23. inspired by George Por of High^Lights publishing 
  24. -- please enhance, distribute, and spread around! 
  25. -- -- (and send me anything neat you come up with! <grin>:) 
  26. -- Raines* Cohen, c/o BMUG, 1442A Walnut #62, Berkeley CA 94709 
  27. -- AppleLink: UG0001.  Delphi,GEnie,BIX, the Well, MCI Mail: BMUG
  28.  -- CIS:70007,2271.  ATT: (415) 849-9114. -- --
  29.  
  30. on mouseUp
  31.   if the selection is empty then
  32.     set lockText of the target to false -- unlock to enable text editing
  33.     repeat two times
  34.       click at the clickLoc -- double click where the user clicked
  35.     end repeat
  36.     set lockText of the target to true
  37.   end if
  38.   if the selection is not empty then -- we got a hit...
  39.     set lockText of the target to true
  40.     go card selection -- This line is the link... see below.
  41.   end if
  42. end mouseUp
  43.  Alternative* forms of linking include:
  44. -- Searching a field of another stack: [instead of "go card selection" substitute:] put selection into holder
  45. -- holder is a local var, just temporary go to stack
  46. "George's contribution" -- Part of a collaborative project, for instance find
  47. word holder in field "keywords" if the result is "not found" then 
  48. ...
  49. -- Only responding to words with an asterisk after them: [after "end repeat" of double click]
  50.  click at ((last item of rect of the target)-10,  (second item of clickLoc)) with ShiftKey -- shift-click at end of line to catch rest of line -- 10 is the width of the scrollbar
  51. if offset ("*",selection) = length of word 1 of selection then -- last char of 1st word is a "*" => OK to xref ... 
  52. else
  53. click at clickLoc --disable selection
  54. set the lockText of the target to true
  55.  
  56. ... -- Selecting whole line [like SFGetFile]: [instead of repeat loop with
  57. click]: click at (first item of the rect of target),  (second item of the
  58. clickLoc) click at (third item of the rect of target)-10,  (second item of the
  59. clickLoc) with shiftKey ... -- Deferred action [instead of go card...] show
  60. bkgnd button "Do It" -- hidden unless something's selected show bkgnd button
  61. "Cancel selection" Good luck!  Remember to do this on a field with LOCKED
  62. TEXT, or it won t work! -- Raines Cohen
  63.    Team BMUG*
  64. -
  65.